/**
 * 事件队列、事件轮询队列
 */
<!DOCTYPE html>
<html>

<head>
  <title></title>
  <script type="text/javascript">
  var p3 = new Promise(function(resolve, reject) {
    resolve("B");
  });

  var p1 = new Promise(function(resolve, reject) {
    resolve(p3);
  });

  var p2 = new Promise(function(resolve, reject) {
    resolve("A");
  });

  p1.then(function(v) {
    console.log(v);
  });

  p2.then(function(v) {
    console.log(v);
  });
  </script>
</head>

<body>
</body>

</html>